package com.ruoyi.cat.service.impl;

import java.util.List;

import com.ruoyi.cat.domain.AdFinance;
import com.ruoyi.cat.mapper.AdFinanceMapper;
import com.ruoyi.cat.service.IAdFinanceService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 金融广告Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-13
 */
@Service
public class AdFinanceServiceImpl implements IAdFinanceService
{
    @Autowired
    private AdFinanceMapper adFinanceMapper;

    /**
     * 查询金融广告
     * 
     * @param id 金融广告主键
     * @return 金融广告
     */
    @Override
    public AdFinance selectAdFinanceById(Long id)
    {
        return adFinanceMapper.selectAdFinanceById(id);
    }

    @Override
    public AdFinance selectAdFinance() {
        return adFinanceMapper.selectAdFinance();
    }

    /**
     * 查询金融广告列表
     * 
     * @param adFinance 金融广告
     * @return 金融广告
     */
    @Override
    public List<AdFinance> selectAdFinanceList(AdFinance adFinance)
    {
        return adFinanceMapper.selectAdFinanceList(adFinance);
    }

    /**
     * 新增金融广告
     * 
     * @param adFinance 金融广告
     * @return 结果
     */
    @Override
    public int insertAdFinance(AdFinance adFinance)
    {
        adFinance.setCreateTime(DateUtils.getNowDate());
        return adFinanceMapper.insertAdFinance(adFinance);
    }

    /**
     * 修改金融广告
     * 
     * @param adFinance 金融广告
     * @return 结果
     */
    @Override
    public int updateAdFinance(AdFinance adFinance)
    {
        return adFinanceMapper.updateAdFinance(adFinance);
    }

    /**
     * 批量删除金融广告
     * 
     * @param ids 需要删除的金融广告主键
     * @return 结果
     */
    @Override
    public int deleteAdFinanceByIds(Long[] ids)
    {
        return adFinanceMapper.deleteAdFinanceByIds(ids);
    }

    @Override
    public int deleteAdFinance() {
        return adFinanceMapper.deleteAdFinance();
    }

    /**
     * 删除金融广告信息
     * 
     * @param id 金融广告主键
     * @return 结果
     */
    @Override
    public int deleteAdFinanceById(Long id)
    {
        return adFinanceMapper.deleteAdFinanceById(id);
    }
}
